package ws.jdbc.concurrent.test.tasks.read;

import java.sql.*;
import ws.jdbc.concurrent.test.tasks.ResultSetRunnable;

/**
 * This task reads data directly from a {@link ResultSet}.
 * 
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public class ResultSetRead extends ResultSetRunnable {

  public ResultSetRead() throws SQLException {
    super();
  }

  public void run() {
    try {
      while (rs.next()) {
        num = rs.getInt(1);
        str1 = rs.getString(2);
        str2 = rs.getString(3);
        decimal = rs.getFloat(4);
      }
      st.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
    }
  }
}
